package com.dtm.model;

import java.io.Serializable;

import com.dtm.R;

public class User implements Serializable{

	private String name;
	private int avatar;
	private int idAvt;
	private Boolean bStatus = false;
	
	public User(String name, int avatar, Boolean bBoolean){
		this.name = name;
		this.avatar = avatar;
		this.bStatus = bBoolean;
		intToID();
	}
	
	public User(String name, int avatar){
		this.name = name;
		this.avatar = avatar;
		intToID();
	}
	
	public static int getImage(int i) {
		switch(i) {
		case 1:
			return R.drawable.a1;
		case 2:
			return R.drawable.a2;
		case 3:
			return R.drawable.a3;
		case 4:
			return R.drawable.a4;
		case 5:
			return R.drawable.a5;
		case 6:
			return R.drawable.a6;
		case 7:
			return R.drawable.a7;
		case 8:
			return R.drawable.a8;
		default :
			return R.drawable.a0;
		}
	}
	
	
	public void intToID() {
		if(avatar == 1){
			idAvt = R.drawable.a1;
		}
		else if(avatar == 2){
			idAvt = R.drawable.a2;
		}
		else if(avatar == 3){
			idAvt = R.drawable.a3;
		}
		else if(avatar == 4){
			idAvt = R.drawable.a4;
		}
		else if(avatar == 5){
			idAvt = R.drawable.a5;
		}
		else if(avatar == 6){
			idAvt = R.drawable.a6;
		}
		else if(avatar == 7){
			idAvt = R.drawable.a7;
		}
		else if(avatar == 8){
			idAvt = R.drawable.a8;
		}
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAvatar() {
		return avatar;
	}

	public void setAvatar(int avatar) {
		this.avatar = avatar;
	}
	
	public int getIdAvt() {
		return idAvt;
	}

	public void setIdAvt(int idAvt) {
		this.idAvt = idAvt;
	}

	public User(){
		intToID();
	}

	public Boolean getbStatus() {
		return bStatus;
	}

	public void setbStatus(Boolean bStatus) {
		this.bStatus = bStatus;
	}
	
	
}
